<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>

  <head>
    <title>$Title$</title>
    <link rel="stylesheet" href="./bootstrap-3.3.7-dist/css/bootstrap.min.css">
    <script src="./bootstrap-3.3.7-dist/js/jquery-3.4.1.min.js" type="text/javascript"></script>
    <script src="./bootstrap-3.3.7-dist/js/bootstrap.min.js" type="text/javascript"></script>
  </head>
  <style>
    .main{
      width:500px;
      height:400px;
      border: #0000ff solid 1px;
      margin:auto;
    }
    .box1{
      margin:50px 0 0 110px;
    }
    .a1{

      margin-top:50px;
    }
    .a2{
      margin-left:20px;
    }
  </style>
  <body>
  <div class="main">
    <div class="box1">
      <h2 class="a2">你好，${cookie.user.value}</h2>
      <h2 class="a2">请选择你的管理功能</h2>
      <div class="a1">
        <button type="button" id="btn1" class="btn btn-info">学生管理功能</button>
        &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp &nbsp&nbsp&nbsp&nbsp
        <button type="button" id="btn2"class="btn btn-info">班级管理功能</button>
        &nbsp&nbsp&nbsp
        <button type="button" id="btn3"class="btn btn-danger">返回</button>
      </div>

    </div>
  </div>
  </body>
</html>
<script type="text/javascript">
  $("#btn1").on("click", function () {
    // 获取模块路径信息：/module01/manageStudent.jsp
    var modulePathName = window.document.location.pathname;
    // 获取模块名称：/module01
    var moduleName = modulePathName.substring(0, modulePathName.substr(1).indexOf('/') + 1);
    // 拼接结果为：id=1&id=2
    window.location.href = moduleName + "/ServletMessage?method=findAll";
  });
  $("#btn2").on("click", function () {
    // 获取模块路径信息：/module01/manageStudent.jsp
    var modulePathName = window.document.location.pathname;
    // 获取模块名称：/module01
    var moduleName = modulePathName.substring(0, modulePathName.substr(1).indexOf('/') + 1);
    // 拼接结果为：id=1&id=2
    window.location.href = moduleName + "/ClassMessage?method=findAll";
  })
  $("#btn3").on("click", function () {
    // 获取模块路径信息：/module01/manageStudent.jsp
    var modulePathName = window.document.location.pathname;
    // 获取模块名称：/module01
    var moduleName = modulePathName.substring(0, modulePathName.substr(1).indexOf('/') + 1);
    // 拼接结果为：id=1&id=2
    window.location.href = moduleName + "/index.jsp";
  });
</script>